package com.cyw.controller;

import com.cyw.service.FileParse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @Author: Chenyw
 * @Date: 2022/09/07/15:13
 */
@RestController
@RequestMapping("/parse")
public class FileParseController {
    @Autowired
    private FileParse fileParse;

    @GetMapping("image")
    public String parseImage(String filePath) throws IOException {
        fileParse.parseLocalFile(filePath);
        return "success";
    }

    @GetMapping("video")
    public String parseVideo(String filePath) throws IOException {
        fileParse.parseLocalFile(filePath);
        return "success";
    }
}
